package com.itheima.demo001;

import java.util.Scanner;

public class exercise39 {
    public static void main(String[] args) {
        //Java基础学完，进行综合测评
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入机票原价");
        int price = sc.nextInt();
        System.out.println("请输入买票月份");
        int month = sc.nextInt();
        System.out.println("请输入购买的舱位 0头等舱，1经济舱");
        int choose = sc.nextInt();
        //ctrl + alt + M 自动抽取方法

        if(month >= 5 && month <= 10){
            if(choose == 0){
                //头等舱
                price = (int)(price * 0.9);
            }else if(choose == 1){
                //经济舱
                price = (int)(price * 0.85);
            }else{
                System.out.println("请输入正确的舱位");
            }
        }else if(month >= 1 && month <= 4 || month >= 11 && month <= 12){
            if(choose == 0){
                //头等舱
                price = (int)(price * 0.7);
            }else if(choose == 1){
                //经济舱
                price = (int)(price * 0.65);
            }else{
                System.out.println("请输入正确的舱位");
            }
        }else{
            System.out.println("键盘录入的月份错误");
        }
        System.out.println(price);
    }
}
